import numpy as np
from PIL import Image

# Make random 28x28 RGB image
img =np.random.randint(0,256,(28,28,3), dtype=np.uint8)
# Convert to PIL Image
pImg=Image.fromarray(img, mode='RGB')
pImg.save('result.png')